package jsave.action;

import java.io.File;

import jsave.exception.JSaveArretSauvegarde;
import jsave.exception.JSaveException;
import jsave.tree.FileNode;
import jsave.util.Console;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;

public class ActionMAJSource extends Action {

	private static final Logger log = Logger.getLogger(ActionMAJSource.class);

	public ActionMAJSource(int typeAction) {

		super();

		if (typeAction == Action.ACTION_C || typeAction == Action.ACTION_D) {
			this.typeAction = typeAction;
		} else {
			log.log(Level.ERROR, "ERREUR - Le type d'action '" + typeAction
					+ "' ne correspond pas a l'action 'ActionMAJSource' ");
		}
	}

	public void executer(File s, File d) throws JSaveArretSauvegarde {

		if (afficherLogModif)
			Console.logInfo("MS - " + s.getPath());
		MAJFichier(d, s);
	}

	public String getNom() {
		return "MAJ SOURCE";
	}

	@Override
	public void executer(String sourcePath, String destinatinoPath, FileNode n)
			throws JSaveException {
		throw new JSaveException("Methode non implementee");
	}
}
